package com.lh.ssm.web;

import com.lh.ssm.domain.User;
import com.lh.ssm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/test")
public class TestController {

    @Autowired
    private UserService userService;

    @ResponseBody
    @GetMapping("/t1")
    public List<User> findAll(){

        List<User> users = userService.findAllUsers();
        return users;
    }


}
